package com.pajk.user.model;

import java.io.Serializable;

import com.pajk.user.model.enums.CreditRuleType;

public class CreditRule extends Entity
implements Serializable{

    private String  actionCode;
    private String  description;
    private Integer credit;
    private Integer times;
    private Byte    status;
    private CreditRuleType creditRuleType;

    public String getActionCode() {
        return actionCode;
    }

    public void setActionCode(String actionCode) {
        this.actionCode = actionCode;
    }

    public String getDesc() {
        return description;
    }

    public void setDesc(String description) {
        this.description = description;
    }

    public Integer getCredit() {
        return credit;
    }

    public void setCredit(Integer credit) {
        this.credit = credit;
    }

    public Integer getTimes() {
        return times;
    }

    public void setTimes(Integer times) {
        this.times = times;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public CreditRuleType getCreditRuleEnum() {
        return creditRuleType;
    }

    public void setCreditRuleType(CreditRuleType creditRuleType) {
        this.creditRuleType = creditRuleType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CreditRule that = (CreditRule) o;

        if (!actionCode.equals(that.actionCode)) return false;
        if (!credit.equals(that.credit)) return false;
        if (creditRuleType != that.creditRuleType) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (!status.equals(that.status)) return false;
        if (!times.equals(that.times)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = actionCode.hashCode();
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + credit.hashCode();
        result = 31 * result + times.hashCode();
        result = 31 * result + status.hashCode();
        result = 31 * result + creditRuleType.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "CreditRuleDO{" +
                "actionCode='" + actionCode + '\'' +
                ", desc='" + description + '\'' +
                ", credit=" + credit +
                ", times=" + times +
                ", status=" + status +
                ", creditRuleEnum=" + creditRuleType +
                '}';
    }


}
